<template>
  <div class="List" @click="clickDiv">
      <span v-show="staff_type === 1 ">家庭医生</span>
      <span v-show="staff_type === 2 ">康复医生</span>
      <span v-show="staff_type === 3 ">临床医生</span>
      <span v-show="staff_type === 4 ">临床医师</span>
      <span v-show="staff_type === 5 ">康复治疗师</span>
      <span v-show="staff_type === 6 ">照护师</span>
      <span v-show="staff_type === 7 ">康复护士</span>
      <span v-show="staff_type === 8 ">临床护士</span>
      <span v-show="staff_type === 9 ">健康管理师</span>
    <img src="../../assets/更多灰@2x.png" alt="">
  </div>
</template>

<script>
export default {
  name: 'DoctorType',
  data () {
    return {
      doctorInfo: '',
      isLoading: true,
      userid: this.$route.query.userid,
      staff_type: null
    }
  },
  created () {
    this.$route.meta.isShowtabbar = false
  },
  mounted () {
    this.getdoctorInfo()
  },
  methods: {
    clickDiv () {
      // sessionStorage.removeItem('isShowtabbar') // 删除控制底部菜单的参数
      this.$router.push({path: '/DoctorHome', query: {'userid': this.userid}})
    },
    getdoctorInfo () {
      this.$http.findPersonal()
        .then(res => {
          console.log(res)
          this.doctorInfo = res.data.data
          this.staff_type = Number(res.data.staff_type)
          sessionStorage.setItem('selfInformation', JSON.stringify(res.data))
          sessionStorage.setItem('role', res.data.role)
          sessionStorage.setItem('name', res.data.name)
          sessionStorage.setItem('userid', res.data.userid)
        })
        .catch(err => {
          console.log(err)
        })
    }
  }
}
</script>

<style scoped lang="scss">
.List{
  font-size: 15px;
  font-family: "PingFang SC";
  font-weight: bold;
  width: 95%;
  height: 60px;
  background: #FFFFFF;
  border-radius: 10px;
  margin: 8px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding:  0 10px;
  box-sizing: border-box;
  img{
    width: 7px;
    height: 13px;
  }
}
</style>
